<template>
  <div class="item-project">
    <a class="item-before"> <i class="iconfont icon-guanbi"></i> {{obj.title}}</a>
    <div class="item-after" v-backgroundImg="obj.url"></div>
  </div>
</template>
<script>
export default {
  props: {
    obj: Object
  },
  computed: {
    proList: function () {
      return this.obj
    }
  },
  name: 'ItemProject',
  mounted () {
    console.log('aa', this.$refs.aaa)
  }
}
</script>

<style scoped lang='scss'>
.item-project {
  width: 300px;
  height: 300px;
  position: relative;
  transform-style: preserve-3d;
  background-color: #f2f2f2;
  z-index: 9;
  perspective-origin: center center;
  transition: transform 1s;
  -webkit-transition: transform 1s; /* Safari */
  border-radius: 10px;
  border: 1px solid #ccc;
  text-align: center;
  line-height: 300px;
  will-change:transform;
  // overflow: hidden;
}
.item-before {
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.item-after {
  position: absolute;
  top: -1px;
  z-index: 1;
  left: -1px;
  right: 0;
  width: 300px;
  height: 300px;
  background-color: yellow;
  transform: rotateY(180deg);
  perspective-origin: center center;
  border-radius: 10px;
  border: 1px solid #ccc;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.item-project:hover {
  transform: rotateY(180deg);
}
</style>
